<template>
  <view class="contact-service" v-if="visible">
    <view class="mask" @click="handleClose"></view>
    <view class="content">
      <view class="title">联系客服</view>
      <view class="close" @click="handleClose">
        <text class="iconfont icon-close"></text>
      </view>
      <view class="info-list">
        <view class="info-item">
          <text class="label">微信号</text>
          <text class="value wechat-number" @click="copyWechat('Cooper2325')">Cooper2325</text>
          <view class="copy-btn" @click="copyWechat">
            <text class="iconfont icon-fuzhi"></text>
          </view>
        </view>
        <view class="info-item">
          <text class="label">联系电话</text>
          <text class="value phone-number" @click="makePhoneCall">028-87057905</text>
        </view>
      </view>
      <view class="tips">工作时间：周一至周日 9:00-22:00</view>
    </view>
  </view>
</template>

<script>
export default {
  name: 'ContactService',
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    handleClose() {
      this.$emit('update:visible', false)
    },
    copyWechat(data) {
      uni.setClipboardData({
        data: data,
        success: () => {
          uni.showToast({
            title: '已复制',
            icon: 'none',
            duration: 1500
          })
        }
      })
    },
    makePhoneCall() {
      uni.makePhoneCall({
        phoneNumber: '028-87057905'
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.contact-service {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  
  .mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
  }
  
  .content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600rpx;
    background: #fff;
    border-radius: 20rpx;
    padding: 40rpx;
    box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
    
    .title {
      font-size: 36rpx;
      font-weight: bold;
      color: #333;
      text-align: center;
      margin-bottom: 40rpx;
    }
    
    .close {
      position: absolute;
      top: 20rpx;
      right: 20rpx;
      padding: 10rpx;
      
      .iconfont {
        font-size: 40rpx;
        color: #999;
      }
    }
    
    .info-list {
      margin-bottom: 30rpx;
      
      .info-item {
        display: flex;
        align-items: center;
        margin-bottom: 30rpx;
        
        &:last-child {
          margin-bottom: 0;
        }
        
        .label {
          width: 160rpx;
          font-size: 28rpx;
          color: #666;
        }
        
        .value {
          flex: 1;
          font-size: 32rpx;
          color: #333;
          font-weight: 500;
          
          &.wechat-number {
            cursor: pointer;
            
            &:hover {
              color: #007AFF;
            }
          }
          
          &.phone-number {
            color: #007AFF;
            text-decoration: underline;
          }
        }

        .copy-btn {
          padding: 0 20rpx;
          .iconfont {
            font-size: 36rpx;
            color: #666;
          }
        }
      }
    }
    
    .tips {
      font-size: 24rpx;
      color: #999;
      text-align: center;
    }
  }
}
</style> 